package com.tanhua.manage.controller;

import com.tanhua.manage.service.AnalysisByDayService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.text.ParseException;
import java.util.Date;

@RestController
@Slf4j
@RequestMapping("/dashboard")
public class AnalysisController {


    @Autowired
    private AnalysisByDayService analysisByDayService;

    /**
     * 接口名称：概要统计信息
     * =接口路径：GET/dashboard/summary
     */
    @GetMapping("/summary")
    public ResponseEntity summary() {
        return analysisByDayService.summary();
    }

    @GetMapping("/users")
    public ResponseEntity summaryStatistics(Long sd, Long ed, String type) throws ParseException {
        return analysisByDayService.summaryStatistics(sd,ed,type);
    }

}
